﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsStateService.Monitor
{
    public class DiskInfo
    {
        public float? Usage { get; set; } = -1;

        public float? Temperature { get; set; } = -1;

        public IList<DiskPartitionInfo> DiskInfos { get; set; }
    }

    public class DiskPartitionInfo
    {
        /// <summary>
        /// 磁盘ID 如：D:
        /// </summary>
        public string DeviceID { get; set; }
        /// <summary>
        /// 驱动器类型。3为本地固定磁盘，2为可移动磁盘
        /// </summary>
        public uint DriveType { get; set; }
        /// <summary>
        /// 磁盘名称。如：系统
        /// </summary>
        public string VolumeName { get; set; }
        /// <summary>
        /// 描述。如：本地固定磁盘
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 文件系统。如：NTFS
        /// </summary>
        public string FileSystem { get; set; }
        /// <summary>
        /// 磁盘容量（GB）
        /// </summary>
        public double Size { get; set; } = 0;
        /// <summary>
        /// 可用空间（GB）
        /// </summary>
        public double FreeSpace { get; set; } = 0;

        public double Usage { get; set; } = 0;

        public override string ToString()
        {
            return $"{VolumeName}({DeviceID}), {FreeSpace}GB is available for {Size}GB in total, {FileSystem}, {Description}";
        }
    }
}
